import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule, RouteReuseStrategy, Routes } from '@angular/router';
import { HttpClientModule } from '@angular/common/http';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
import { NavigationBar } from '@ionic-native/navigation-bar/ngx';
import { AndroidFullScreen } from '@ionic-native/android-full-screen/ngx';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { PopoverComponent } from './popover/popover.component';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { ServiceProxyModule } from '../shared/service-proxies/service-proxy.module';
import { API_BASE_URL } from '../shared/service-proxies/service-proxies';
import { AppConsts } from '../shared/AppConsts';
import { IonicStorageModule } from '@ionic/storage';
import { AppCommonModule } from './shared/common/app-common.module';
import { LoginPageModule } from './login/login.module';

export function getRemoteServiceBaseUrl(): string {
  return AppConsts.remoteServiceBaseUrl;
}

@NgModule({
  declarations: [AppComponent, PopoverComponent, ],
  entryComponents: [],
  imports: [
    BrowserModule, 
    HttpClientModule,
    IonicModule.forRoot(), 
    AppRoutingModule,
    ServiceProxyModule,
    IonicStorageModule.forRoot(),
    AppCommonModule.forRoot(),
    LoginPageModule,
  ],
  exports: [
    LoginPageModule,
    
  ],
  providers: [
    StatusBar,
    SplashScreen,
    ScreenOrientation,
    NavigationBar,
    AndroidFullScreen,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
    { provide: API_BASE_URL, useFactory: getRemoteServiceBaseUrl },
  ],
  bootstrap: [AppComponent]
})
export class AppModule {

}
